package com.fifth.commodity.feign;

import com.fifth.common.pojo.dto.CommonResult;
import com.fifth.common.pojo.entity.Collection;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @作者：刘壬杉
 * @创建时间 2022/9/8 19:52
 **/
@FeignClient(value = "mrcai-user")
public interface CollectionFeign {
    /**
     * 根据goodsid和uid(逻辑删除列为0)查询Collection实体类
     * @param goodsid
     * @param uid
     * @return
     */
    @PostMapping("api/user/collection/isGoodsCollection/{goodsid}/{uid}")
    public Collection isGoodsCollection(@PathVariable String goodsid,@PathVariable String uid);

    /**
     * 添加收藏
     * @param
     * @return
     */
    @PostMapping("api/user/collection/insertCollection/{goodsid}/{uid}")
    CommonResult insertCollection(@PathVariable String goodsid,@PathVariable String uid);

    /**
     * 取消收藏
     * @param goodsid
     * @return
     */
    @PostMapping("api/user/collection/deleteGid/{goodsid}/{uid}")
    CommonResult deleteCollection(@PathVariable String goodsid,@PathVariable String uid);

    /**
     * 根据bid和uid返回collection实体类
     * @param bid
     * @param uid
     * @return
     */
    @PostMapping("api/user/collection/selectBidAUid/{bid}/{uid}")
    Collection selectBidAUid(@PathVariable String bid,@PathVariable String uid);

    /**
     * 根据uid,bid添加收藏信息
     * @param bid
     * @param uid
     * @return
     */
    @PostMapping("api/user/collection/insertBid/{bid}/{uid}")
    CommonResult insertBid(@PathVariable String bid,@PathVariable String uid);

    /**
     * 根据uid,bid删除收藏信息
     * @param bid
     * @param uid
     * @return
     */
    @PostMapping("api/user/collection/deleteByBid/{bid}/{uid}")
    CommonResult deleteByBid(@PathVariable String bid,@PathVariable String uid);

    /**
     * 根据uid获取所有收获地址
     * @param uid
     * @return
     */
    @PostMapping("user/addr/findByUId/{uid}")
    CommonResult findByUId(@PathVariable String uid);
}
